import java.util.Arrays;

public class FoxCardGame {
	public double theMaxProportion(double[] pileA, double[] pileB, int k) {
		Arrays.sort(pileA);
		Arrays.sort(pileB);
		double ans = 0;
		for (int i = 0; i <= k; i++) {
			for (int j = 0; j <= k - i; j++) {
				for (int l = 0; l <= k - i - j; l++) {
					int m = k - i - j - l;
					double nominator = 0;
					double denominator = 0;
					for (int n = 0; n < i; n++) {
						double sum = pileA[n] + pileB[n];
						double mul = pileA[n] * pileB[n];
						nominator += Math.max(sum, mul);
						denominator += Math.min(sum, mul);
					}
					for (int n = 0; n < j; n++) {
						double sum = pileA[i + n] + pileB[i + j - n - 1];
						double mul = pileA[i + n] * pileB[i + j - n - 1];
						nominator += Math.max(sum, mul);
						denominator += Math.min(sum, mul);
					}
					for (int n = i + j; n < i + j + l; n++) {
						double sum = pileA[n] + pileB[n];
						double mul = pileA[n] * pileB[n];
						nominator += Math.max(sum, mul);
						denominator += Math.min(sum, mul);
					}
					for (int n = pileA.length - m; n < pileA.length; n++) {
						double sum = pileA[n] + pileB[n];
						double mul = pileA[n] * pileB[n];
						nominator += Math.max(sum, mul);
						denominator += Math.min(sum, mul);
					}
					ans = Math.max(ans, nominator / denominator);
				}
			}
		}
		return ans;
	}


// BEGIN CUT HERE
	public static void main(String[] args) {
		if (args.length == 0) {
			FoxCardGameHarness.run_test(-1);
		} else {
			for (int i=0; i<args.length; ++i)
				FoxCardGameHarness.run_test(Integer.valueOf(args[i]));
		}
	}
// END CUT HERE
}

// BEGIN CUT HERE
class FoxCardGameHarness {
	public static void run_test(int casenum) {
		if (casenum != -1) {
			if (runTestCase(casenum) == -1)
				System.err.println("Illegal input! Test case " + casenum + " does not exist.");
			return;
		}
		
		int correct = 0, total = 0;
		for (int i=0;; ++i) {
			int x = runTestCase(i);
			if (x == -1) {
				if (i >= 100) break;
				continue;
			}
			correct += x;
			++total;
		}
		
		if (total == 0) {
			System.err.println("No test cases run.");
		} else if (correct < total) {
			System.err.println("Some cases FAILED (passed " + correct + " of " + total + ").");
		} else {
			System.err.println("All " + total + " tests passed!");
		}
	}
	
	static final double MAX_DOUBLE_ERROR = 1E-9;
	static boolean compareOutput(double expected, double result){ if(Double.isNaN(expected)){ return Double.isNaN(result); }else if(Double.isInfinite(expected)){ if(expected > 0){ return result > 0 && Double.isInfinite(result); }else{ return result < 0 && Double.isInfinite(result); } }else if(Double.isNaN(result) || Double.isInfinite(result)){ return false; }else if(Math.abs(result - expected) < MAX_DOUBLE_ERROR){ return true; }else{ double min = Math.min(expected * (1.0 - MAX_DOUBLE_ERROR), expected * (1.0 + MAX_DOUBLE_ERROR)); double max = Math.max(expected * (1.0 - MAX_DOUBLE_ERROR), expected * (1.0 + MAX_DOUBLE_ERROR)); return result > min && result < max; } }
	static double relativeError(double expected, double result) { if (Double.isNaN(expected) || Double.isInfinite(expected) || Double.isNaN(result) || Double.isInfinite(result) || expected == 0) return 0; return Math.abs(result-expected) / Math.abs(expected); }
	
	static String formatResult(double res) {
		return String.format("%.10g", res);
	}
	
	static int verifyCase(int casenum, double expected, double received) { 
		System.err.print("Example " + casenum + "... ");
		if (compareOutput(expected, received)) {
			System.err.print("PASSED");
			double rerr = relativeError(expected, received);
			if (rerr > 0) System.err.printf(" (relative error %g)", rerr);
			System.err.println();
			return 1;
		} else {
			System.err.println("FAILED");
			System.err.println("    Expected: " + formatResult(expected)); 
			System.err.println("    Received: " + formatResult(received)); 
			return 0;
		}
	}

	static int runTestCase(int casenum) {
		switch(casenum) {
		case 0: {
			double[] pileA            = {1, 2, 3};
			double[] pileB            = {4, 5, 6};
			int k                     = 2;
			double expected__         = 1.7692307692309948;

			return verifyCase(casenum, expected__, new FoxCardGame().theMaxProportion(pileA, pileB, k));
		}
		case 1: {
			double[] pileA            = {1.234, 5.678, 9.012, 3.456, 7.89};
			double[] pileB            = {2.345, 6.789, 9.876, 5.432, 1.012};
			int k                     = 3;
			double expected__         = 4.159424420079586;

			return verifyCase(casenum, expected__, new FoxCardGame().theMaxProportion(pileA, pileB, k));
		}
		case 2: {
			double[] pileA            = {1, 1.1, 1.2, 1.3, 1.4, 1.5};
			double[] pileB            = {5, 10, 15, 20, 25, 30};
			int k                     = 2;
			double expected__         = 1.3972602739726827;

			return verifyCase(casenum, expected__, new FoxCardGame().theMaxProportion(pileA, pileB, k));
		}
		case 3: {
			double[] pileA            = {85.302, 92.798, 76.813, 37.994, 36.737, 98.659};
			double[] pileB            = {13.352, 7.3094, 54.761, 8.2706, 63.223, 37.486};
			int k                     = 3;
			double expected__         = 33.58603889836175;

			return verifyCase(casenum, expected__, new FoxCardGame().theMaxProportion(pileA, pileB, k));
		}

		// custom cases

/*      case 4: {
			double[] pileA            = ;
			double[] pileB            = ;
			int k                     = ;
			double expected__         = ;

			return verifyCase(casenum, expected__, new FoxCardGame().theMaxProportion(pileA, pileB, k));
		}*/
/*      case 5: {
			double[] pileA            = ;
			double[] pileB            = ;
			int k                     = ;
			double expected__         = ;

			return verifyCase(casenum, expected__, new FoxCardGame().theMaxProportion(pileA, pileB, k));
		}*/
/*      case 6: {
			double[] pileA            = ;
			double[] pileB            = ;
			int k                     = ;
			double expected__         = ;

			return verifyCase(casenum, expected__, new FoxCardGame().theMaxProportion(pileA, pileB, k));
		}*/
		default:
			return -1;
		}
	}
}

// END CUT HERE
